<template>
	<view class="uni_box home">
		<navbar title='提现记录'>
		</navbar>
		<view class="content">
			<view class="ztwo">
				<view class="jione">
					<text class="shouname">提现记录 </text>
					<text class="miao" v-if="date">{{ date }}</text>
					<image class="icon_rl" @click="timeshow=true" src="/static/img/icon_rl.png" mode="" />
				</view>
				<view class="nlist" v-if="list!=''">
					<view class="nitem" v-for="(item,index) in list" :key="index">
						<!-- <text class="name">提现状态：{{item.status_text}}</text> -->
						
						<view class="tizhuang">
							<text class="name">{{item.order_sn}}</text>
							<text class="ml ztai">{{item.status_text}}</text>
						</view>
						<text class="time">{{item.createtime}}</text>
						
						<view class="fuview">
							<text class="funame">服务费：<text class="funum">{{ item.change_fee }}</text></text>
							<text class="funame ml">提现金额：<text class="funum price">{{item.money}}</text></text>
						</view>
						<text class="time" style="color: red;" v-if="item.memo">拒绝原因：{{item.memo}}</text>
					</view>
				</view>
			</view>

			<!-- 时间选择 -->
			<u-calendar v-model="timeshow" :mode="mode" @change="change"></u-calendar>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				timeshow:false,
				mode: 'date',
				date:'',
				list: [],
				page: 1,
				limit: 10,
				last_page: 1,
				status: "loadmore",
			}
		},
		onLoad() {
			this.getList()
		},
		onShow() {
		},
		onReachBottom: function () {
			this.loadmore();
		},
		methods: {
			gettixian(){
				this.navrouter("/pages_subject/twoPage/Tixian");
			},
			change(e){
				console.log(e)
				this.date = e.result
			},
			async getList(){//列表数据
				let res = await this.$u.api.getWithdrawList({
					// limit:this.limit,
					  page:this.page
				});
				this.last_page = res.lastpage;
				let list = res.list;
				this.list = this.page == 1 ? list : [...this.list, ...list];	
				if(this.page >= this.last_page){
				  this.status = 'nomore';
				}
				
			},
			loadmore() {
				let page = this.page;
				if (this.status == 'loadmore') {
					this.page++;
					this.getList();
				}
			},
		}
	}
</script>

<style lang="scss" scoped>
	page{
		background-color: #fff;
	}
	.content{
		min-height: 100vh;
		background-color: #f5f5f5;
		padding: 30rpx;
		
		.ztwo{
			.jione{
				display: flex;
				flex-direction: row;
				align-items: center;
				margin-bottom: 30rpx;
				.icon_rl{
					margin-left: auto;
					width: 40rpx;
					height: 40rpx;
				}
			}
			.shouname{
				font-family: PingFang SC;
				font-weight: bold;
				font-size: 36rpx;
				color: #222222;
				display: block;
				
			}
			.miao{
				font-family: PingFang SC;
				font-weight: 500;
				font-size: 22rpx;
				color: #999999;
				display: inline-block;
				margin-left: 20rpx;
			}
			.nlist{
				background: #FFFFFF;
				border-radius: 20rpx;
				padding: 10rpx 30rpx;
				.nitem{
					display: flex;
					padding: 20rpx 0;
					border-bottom: 1rpx solid #eee;
					flex-direction: column;
					.tizhuang{
						display: flex;
						flex-direction: row;
						align-items: center;

					}
					.name{
						font-family: PingFang SC;
						font-weight: 500;
						font-size: 28rpx;
						color: #333333;
						display: inline-block;
						width: 80%;
					}
					.ztai{
						color: red;
						font-size: 30rpx;
						font-weight: 500;
					}
					.time{
						font-family: PingFang SC;
						font-weight: 500;
						font-size: 22rpx;
						color: #999999;
						display: block;
						margin-top: 10rpx;
					}
					.fuview{
						display: flex;
						flex-direction: row;
						margin-top: 10rpx;
						.funame{
							font-family: PingFang SC;
							font-weight: 500;
							font-size: 24rpx;
							color: #666666;
							.funum{
								font-family: PingFang SC;
								font-weight: bold;
								font-size: 30rpx;
								color: #333333;
							}
							.price{
								font-family: PingFang SC;
								font-weight: bold;
								font-size: 30rpx;
								color: #F24646;
							}
						}
						.ml{
							margin-left: auto;
						}
					}
				}
			}
		}
	}
	
</style>
